package com.ibeeking.found.cms.b.rest.controller.v1.feign;

import com.ibeeking.found.cms.api.common.dto.PageBaseInfoDTO;
import com.ibeeking.found.cms.api.common.query.PageBaseInfoQuery;
import com.ibeeking.found.cms.b.rest.service.IPageBaseService;
import com.ibeeking.found.common.db.annotation.Read;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName PageBaseController控制器
 * @Description
 * @Author ibeeking
 * @Date 2021-05-08 16:05
 **/
@RestController
@RequestMapping("/b/cms/feign/v1")
public class PageFeignController {

    @Resource
    private IPageBaseService pageBaseServiceImpl;

    @Read
    @Log(logType = OperateLogTypeEnum.QUERY, describe = "页面信息查询")
    @PostMapping(value = "/pageBaseInfoList")
    public List<PageBaseInfoDTO> pageBaseInfoList(@RequestBody List<PageBaseInfoQuery> query) {
        return pageBaseServiceImpl.pageBaseInfoList(query);
    }

    @Read
    @Log(logType = OperateLogTypeEnum.QUERY, describe = "根据页面类型查询页面信息")
    @GetMapping(value = "/pageBaseInfoListByPageType/{pageType}")
    public List<PageBaseInfoDTO> pageBaseInfoListByPageType(@PathVariable("pageType") Integer pageType) {
        return pageBaseServiceImpl.pageBaseInfoListByPageType(pageType);
    }
}